<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="hexo博客," />










<meta name="description" content="开始创建1.进入一个安全的目录，比如 cd ~/Desktop 或者 cd ~/Documents2.npm install -g hexo-cli，安装 Hexo3.hexo init myBlog4.cd myBlog5.npm i6.hexo new 开博大吉，你会看到一个 md 文件的路径7.start xxxxxx.md（XXX此时为开博大吉）8.start _config.yml，编辑">
<meta name="keywords" content="hexo博客">
<meta property="og:type" content="article">
<meta property="og:title" content="关于Hexo博客搭建的教程">
<meta property="og:url" content="http://yoursite.com/2018/03/18/关于Hexo博客搭建的教程/index.html">
<meta property="og:site_name" content="From&#39;s blog">
<meta property="og:description" content="开始创建1.进入一个安全的目录，比如 cd ~/Desktop 或者 cd ~/Documents2.npm install -g hexo-cli，安装 Hexo3.hexo init myBlog4.cd myBlog5.npm i6.hexo new 开博大吉，你会看到一个 md 文件的路径7.start xxxxxx.md（XXX此时为开博大吉）8.start _config.yml，编辑">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2018-03-21T04:20:15.372Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="关于Hexo博客搭建的教程">
<meta name="twitter:description" content="开始创建1.进入一个安全的目录，比如 cd ~/Desktop 或者 cd ~/Documents2.npm install -g hexo-cli，安装 Hexo3.hexo init myBlog4.cd myBlog5.npm i6.hexo new 开博大吉，你会看到一个 md 文件的路径7.start xxxxxx.md（XXX此时为开博大吉）8.start _config.yml，编辑">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/03/18/关于Hexo博客搭建的教程/"/>





  <title>关于Hexo博客搭建的教程 | From's blog</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="default">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">From's blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/03/18/关于Hexo博客搭建的教程/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wang hang">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="From's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">关于Hexo博客搭建的教程</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-03-18T19:52:46+08:00">
                2018-03-18
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="开始创建"><a href="#开始创建" class="headerlink" title="开始创建"></a>开始创建</h3><p>1.进入一个安全的目录，比如 <code>cd ~/Desktop</code> 或者 <code>cd ~/Documents</code><br>2.<code>npm install -g hexo-cli</code>，安装 Hexo<br>3.<code>hexo init myBlog</code><br>4.<code>cd myBlog</code><br>5.<code>npm i</code><br>6.<code>hexo new 开博大吉</code>，你会看到一个 md 文件的路径<br>7.<code>start xxxxxx.md</code>（XXX此时为开博大吉）<br>8.<code>start _config.yml</code>，编辑网站配置<br>9._config.yml内要编辑的内容</p>
<ul>
<li>把第 6 行的 <code>title:xxx</code>  改成你想要的博客名字</li>
<li>把第 9 行的 <code>author:xxx</code> 改成姓名</li>
<li>把最后一行的 <code>type</code> 改成 <code>type: git</code>（记住前面有个空格）</li>
<li>在最后一行后面新增一行，左边与 <code>type</code> 平齐，加上一行 <code>repo: 仓库地址：xxxxx</code>（在github上创建一个空的仓库，此处填写地址，最好为SSH地址）  </li>
</ul>
<p>10.<code>npm install hexo-deployer-git --save</code>，安装 git 部署插件<br>11.<code>hexo deploy</code><br>12.进入「你的用户名.github.io」对应的 repo，打开 GitHub Pages 功能，如果已经打开了，就直接点击预览链接<br>13.搞定！</p>
<h3 id="第二篇博客"><a href="#第二篇博客" class="headerlink" title="第二篇博客"></a>第二篇博客</h3><p>1.<code>hexo new 第二篇博客</code><br>2.复制显示的路径，使用 start 路径 来编辑它<br>3.<code>hexo generate</code><br>4.<code>hexo deploy</code><br>5.去看你的博客，应该能看到第二篇博客了</p>
<h3 id="换主题"><a href="#换主题" class="headerlink" title="换主题"></a>换主题</h3><p><a href="https://github.com/hexojs/hexo/wiki/Themes" target="_blank" rel="noopener">https://github.com/hexojs/hexo/wiki/Themes</a> 上面有很多主题随意挑选，按下面步骤更换<br>1.随便找一个主题，进入主题的 GitHub 首页，比如我找的是 <a href="https://github.com/iissnan/hexo-theme-next" target="_blank" rel="noopener">https://github.com/iissnan/hexo-theme-next</a><br>2.复制它的 SSH 地址或 HTTPS 地址，假设地址为 <a href="mailto:git@github.com" target="_blank" rel="noopener">git@github.com</a>:iissnan/hexo-theme-next.git<br>3.<code>cd themes</code><br>4.<code>git clone git@github.com:iissnan/hexo-theme-next.git</code><br>5.<code>cd ..</code><br>6.将 _config.yml 的第 75 行改为 <code>theme: hexo-theme-next</code>，保存<br>7.<code>hexo generate</code><br>8.<code>hexo deploy</code><br>9.等一分钟，然后刷新你的博客页面，你会看到一个新的外观。如果不喜欢这个主题，就回到第 1 步，重选一个主题<br>10.之后的主题切换直接在<code>_config.yml</code> 的第 75 行进行修改名字即可（前提主题以及下载到themes中）</p>
<h2 id="切记：仓库（你的用户名-github-io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！"><a href="#切记：仓库（你的用户名-github-io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！" class="headerlink" title="切记：仓库（你的用户名.github.io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！"></a>切记：仓库（你的用户名.github.io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！</h2><h2 id="切记：仓库（你的用户名-github-io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！-1"><a href="#切记：仓库（你的用户名-github-io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！-1" class="headerlink" title="切记：仓库（你的用户名.github.io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！"></a>切记：仓库（你的用户名.github.io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！</h2><h2 id="切记：仓库（你的用户名-github-io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！-2"><a href="#切记：仓库（你的用户名-github-io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！-2" class="headerlink" title="切记：仓库（你的用户名.github.io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！"></a>切记：仓库（你的用户名.github.io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！</h2>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/hexo博客/" rel="tag"># hexo博客</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/03/20/一-自主学习过程中需要掌握的方法/" rel="prev" title="自主学习过程中需要掌握的方法">
                自主学习过程中需要掌握的方法 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            Overview
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Wang hang</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">52</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">tags</span>
                
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#开始创建"><span class="nav-number">1.</span> <span class="nav-text">开始创建</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#第二篇博客"><span class="nav-number">2.</span> <span class="nav-text">第二篇博客</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#换主题"><span class="nav-number">3.</span> <span class="nav-text">换主题</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#切记：仓库（你的用户名-github-io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！"><span class="nav-number"></span> <span class="nav-text">切记：仓库（你的用户名.github.io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#切记：仓库（你的用户名-github-io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！-1"><span class="nav-number"></span> <span class="nav-text">切记：仓库（你的用户名.github.io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#切记：仓库（你的用户名-github-io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！-2"><span class="nav-number"></span> <span class="nav-text">切记：仓库（你的用户名.github.io）名要与GitHub用户名一致！切记！否则你将永远看不到主题！！！</span></a></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wang hang</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
